<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>订单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/order/userOrder/">订单列表</a></li>
		<%-- <shiro:hasPermission name="order:userOrder:edit"><li><a href="${ctx}/order/userOrder/form">订单添加</a></li></shiro:hasPermission> --%>
	</ul>
	<form:form id="searchForm" modelAttribute="userOrder" action="${ctx}/order/userOrder/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		<li><label>订单号：</label>
				<form:input path="orderCode" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
		<%-- <li><label>没有销售订单：</label>
				<form:radiobuttons path="isRecommend" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</li> --%>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>订单号</th>
				<th>用户名</th>
				<th>订单类型</th>
				<th>订单状态</th>
				<th>总金额</th>
				<th>已支付金额</th>
				 <th>跟踪人</th> 
				<th>备注</th>
				<th>操作</th>
			</tr>
			<%-- <tr>
				<shiro:hasPermission name="order:userOrder:edit"><th>操作</th></shiro:hasPermission>
			</tr> --%>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="userOrder">
			<tr>
			<td>${userOrder.orderCode}</td>
			<td>${userOrder.user.loginName}</td>
			<td><c:if test="${userOrder.orderType == '1'}">安装订单
    			</c:if> 
			<c:if test="${userOrder.orderType == '2'}">设计订单
    			</c:if> 
			<c:if test="${userOrder.orderType == '3'}">无订单的售后订单
    			</c:if> 
			<c:if test="${userOrder.orderType == '4'}">有订单的售后订单
    			</c:if> </td>
			<td><c:if test="${userOrder.orderState == '1'}"> 待处理
    			</c:if> 
			<c:if test="${userOrder.orderState == '2'}">待签字
    			</c:if> 
			<c:if test="${userOrder.orderState == '3'}">施工中
    			</c:if> 
			<c:if test="${userOrder.orderState == '4'}">已完成
    			</c:if> 
			<c:if test="${userOrder.orderState == '5'}">已取消
    			</c:if> </td>
			<td>${userOrder.itemPrice}</td>
			<td>${userOrder.paymentPrice}</td>
			
			 <td>${userOrder.omOrderTrack.trackStaffName}</td> 
			<td>${userOrder.comments}</td>
				<shiro:hasPermission name="order:userOrder:edit"><td>
    				<a href="${ctx}/order/userOrder/form?id=${userOrder.orderCode}">详情</a>
				<%-- 	<a href="${ctx}/order/userOrder/delete?id=${userOrder.orderCode}" onclick="return confirmx('确认要删除该订单吗？', this.href)">删除</a> --%>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>